package com.icart.repositories;


import com.icart.entities.FiPrepayfeeEntity;
import com.icart.entities.WoInfopayEntity;
import org.springframework.context.annotation.Scope;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

@Repository
@Scope("prototype")
public interface FiprepayfeeRepository extends BaseRepository<FiPrepayfeeEntity,Integer> {
    @Transactional
    @Query(nativeQuery = true,value = "insert into fi_prepayfee (prefeeid, sourceid, custid, cautname, tcid, tradekind, tradedate, tradefee) " +
            "select ?1,?2,?3,(select custname from cu_custinfo where custid=?4)as cautname,tcid,'prereceivable',?5,saleprice from mk_discpack where tcid=?6")
    @Modifying(clearAutomatically = true)
    Integer savefi(String prefeeid,String oid,Long custid,Long custid2,String time,Long tcid);
}
